/*************************************************************************
	> File Name: Decorator.cc
	> Author: Joker
	> Mail: mahongtao@foxmail.com 
	> Created Time: 2020-09-22 11:36:03
 ************************************************************************/

#include "Decorator.h"

#include <iostream>

using std::cout;
using std::endl;

/************************************
 * Decorator
 *
 * *********************************/
Decorator::~Decorator(){
    delete _pComponent;
    _pComponent = nullptr;
}

/************************************
 * ConcreateComponent
 *
 * *********************************/
void ConcreateComponent::Operation(){
    cout << "Operation of ConcreateComponent" << endl;
}

/************************************
 * ConcreateDecorator
 *
 * *********************************/
void ConcreateDecorator::Operation(){
    _pComponent->Operation();
    ADDedBehavior();
}

void ConcreateDecorator::ADDedBehavior(){
    cout << "ADDedBehavior of ConcreateDecorator" << endl;
}




